<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include.inc.jsp" %>

<script type="text/javascript">
    function delGoodsPackage(){
        alert("asd");
        document.forms[0].action="/basesetting/package!delGoodsPackage";
        document.forms[0].submit();
    }

</script>

<div class="pageContent sortDrag" selector="h1" layoutH="42">

    <div class="panel collapse" minH="100" defH="220">
        <h1>[${goodsPackage.packageName}]-套系编辑</h1>

        <div>
            <form action="/basesetting/package!addGoodsPackage" method="post"
                  class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
                <input type="hidden" name="goodsPackage.id" value="${goodsPackage.id}"/>

                <div class="pageContent">
                    <div class="pageFormContent">
                        <dl>
                            <dt>套系名称:</dt>
                            <dd><input name="goodsPackage.packageName" class="required" type="text"
                                       value="${goodsPackage.packageName}"/></dd>
                        </dl>
                        <dl>
                            <dt>录单人:</dt>
                            <dd><input class="required" name="goodsPackage.inputName" type="text"
                                       value="${loginedUser.ename}"
                                       disabled="true"/></dd>
                        </dl>
                        <dl>
                            <dt>入册张数:</dt>
                            <dd><input name="goodsPackage.photoCount" class="required digits" type="text"
                                       value="${goodsPackage.photoCount}"/></dd>
                        </dl>
                        <dl>
                            <dt>入盘张数:</dt>
                            <dd><input name="goodsPackage.cdCount" class="required digits" type="text"
                                       value="${goodsPackage.cdCount}"/></dd>
                        </dl>
                        <dl>
                            <dt>商品买入价格:</dt>
                            <dd><input name="goodsPackage.packageBuyPrice" class="required number" type="text"
                                       value="${goodsPackage.packageBuyPrice}"/></dd>
                        </dl>
                        <dl>
                            <dt>商品卖出价格:</dt>
                            <dd><input name="goodsPackage.packageSellPrice" class="required number" type="text"
                                       value="${goodsPackage.packageSellPrice}"/></dd>
                        </dl>
                        <dl>
                            <dt>相册数量:</dt>
                            <dd><input name="goodsPackage.boxCount" class="required digits" type="text"
                                       value="${goodsPackage.boxCount}"/>
                            </dd>
                        </dl>
                        <dl>
                            <dt>是否启用:</dt>
                            <dd><input name="goodsPackage.packageStatus" type="radio" value="0" checked=""/>是
                                <input name="goodsPackage.packageStatus" type="radio" value="1"
                                       <c:if test="${goodsPackage.packageStatus==1}">checked="true" </c:if> />否
                            </dd>
                        </dl>

                        <dl>
                            <dt>描述:</dt>
                            <dd><input name="goodsPackage.packageDescribe" type="text"
                                       value="${goodsPackage.packageDescribe}"
                                       size="100"/>
                            </dd>
                        </dl>
                    </div>
                    <div class="formBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit">保存</button>
                                    </div>
                                </div>
                            </li>
                            <li>
                                <div class="button">
                                    <div class="buttonContent">
                                        <button class="close" type="submit" onclick="alertMsg.warn('您提交的数据有误，请检查后重新提交！');delGoodsPackage()">删除</button>
                                     <%--   <a   href="/management!deleteUser?user.id={sid_user}" target="dialog"
                                           title="确定要删除吗?" onclick="alertMsg.warn('您提交的数据有误，请检查后重新提交！')"><span>删除</span></a>--%>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
        </div>
    </div>


    <div class="panel collapse" minH="100" defH="150">
        <h1>[${goodsPackage.packageName}]-套系内容 </h1>

        <div>
            <%--   <div class="divider"></div>
            <div class="panelBar">
                <ul class="toolBar">
                    <li><a class="edit" href="#"><span><b>${gorupManager.gorupName}</b>-旗下员工</span></a>
                    </li>
                </ul>
            </div>--%>


                <div class="pageContent">
                    <div class="panelBar">
                        <ul class="toolBar">
                            <li><a class="add" href="/basesetting/package!toSelectGoods?goodsPackage.id=${goodsPackage.id}" target="dialog"
                                   title="商品添加" width="1000" height="500"><span>添加或者修改</span></a></li>
                           <%-- <li><a class="delete" href="/basesetting/package!delGoodsInfo?goodsInfo.id={sid_goodsInfo}" target="ajaxTodo"
                                   title="确定要删除吗?"><span>删除</span></a></li>
                            <li class="line">line</li>--%>
                        </ul>
                    </div>
                    <table class="table" width="100%" layoutH="138">
                        <thead>
                        <tr>
                            <th width="20"></th>
                            <th width="100">商品编号</th>
                            <th width="100">商品名称</th>
                            <th width="50">商品尺寸</th>
                            <th width="100">商品单位</th>
                            <th width="80">商品成本</th>
                            <th width="80">商品售价</th>
                            <th width="80">是否关联库存</th>
                            <th width="100">商品类别</th>
                        </tr>
                        </thead>
                        <tbody>

                        <c:forEach items="${goodsList}" var="user" varStatus="index">
                            <tr target="sid_goodsInfo" rel="${user.id}">
                                <td>${index.index+1}</td>
                                <td>${user.goodsNo}</td>
                                <td>${user.goodsName}</td>
                                <td>${user.goodsSize}</td>
                                <td>${user.goodsUnit}</td>
                                <td>${user.goodsBuyPrice}</td>
                                <td>${user.goodsSellPrice}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${user.inventoryStatus==0}">
                                            关联
                                        </c:when>
                                        <c:otherwise>
                                            不关联
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td>     <%--消耗品  必需品  内部使用--%>
                                    <c:choose>
                                        <c:when test="${user.goodsStatus==1}">
                                            消耗品
                                        </c:when>
                                        <c:when test="${user.goodsStatus==2}">
                                            必需品
                                        </c:when>
                                        <c:otherwise>
                                            内部使用
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>

                </div>
        </div>
    </div>

</div>
